function jsmantobj(type, idsigma){
	
	var jscidtabl = $("#idparent").val();
	var xurl = urljs + "index.php/sistemas/mantobj?type="+type+"&idsigma="+idsigma+"&cidtabl="+jscidtabl;
	openlight(xurl, 350 ,370,  true);
}

function xdelobjeto(idsigma){
	if(confirm("Anular el Objeto " + idsigma)){
		alert("Anulando " + idsigma);
		urlpage = "index.php/sistemas/xdelobj";
		parametros = "idsigma=" + idsigma;
		
		commonajax(urlpage, parametros, "#sr"+idsigma);
		location.reload();
	}
}

function xmantobjeto(type){
	var jidsigma = $("#txtidsigma").val();
	var jcidtabl = $("#txtcidtabl").val();
	var jctipdat = $("#cboctipdat").val();
	var jvdescri = $("#txtvdescri").val();
	var jvdoform = $("#txtvdoform").val();
	var jvobserv = $("#txtvobserv").val();
	var jnestado = $("#txtnestado").val();
	
	urlpage = "index.php/sistemas/xmantobj";
	parametros = "type=" + type
					+ "&idsigma=" + jidsigma
					+ "&cidtabl=" + jcidtabl
					+ "&ctipdat=" + jctipdat
					+ "&vdescri=" + jvdescri
					+ "&vdoform=" + jvdoform
					+ "&vobserv=" + jvobserv
					+ "&nestado=" + jnestado;

	commonajax(urlpage, parametros, "#dresultado");
}

function PagesObjetosweb(page_index, jq){
	var items_per_page = $("#items_per_page").val();
	var max_elem = Math.min((page_index+1) * items_per_page, members.length);
	var newcontent = "";

	newcontent = '<table class="tabla">';
	newcontent += '<tr>';
	newcontent += '<th >idsigma</th>';
	newcontent += '<th >cidtabl</th>';
	newcontent += '<th >vicono</th>';
	newcontent += '<th >vdescri</th>';
	newcontent += '<th >vdoform</th>';
	newcontent += '<th >vobserv</th>';
	newcontent += '<th >nestado</th>';
	newcontent += '<th ></th>';
	newcontent += '<th ></th>';
	newcontent += '</tr>';
	
	for(var i=page_index*items_per_page; i<max_elem; i++){
		var cadcontentrow = '';
		var link = '<a href="'+urljs+'index.php/sistemas/objetosweb?cidtabl='+members[i][0]+'&nmenu='+members[i][3]+'">'+members[i][0]+'</a>';
		var btnmod = '<img class="topoint" src="'+urljs+'images/modify.ico" onclick="jsmantobj(\'2\',\''+members[i][0]+'\');" width="20px" heigth="20px"/>';
		var btndel = '<img class="topoint" src="'+urljs+'images/delete.ico" onclick="xdelobjeto(\''+members[i][0]+'\');" width="20px" heigth="20px"/>';

		cadcontentrow += '<tr>';
		cadcontentrow += '<td >' + link + '</a></td>';
		cadcontentrow += '<td >' + members[i][1] + '</td>';
		cadcontentrow += '<td >' + members[i][2] + '</td>';
		cadcontentrow += '<td >' + members[i][3] + '</td>';
		cadcontentrow += '<td >' + members[i][4] + '</td>';
		cadcontentrow += '<td >' + members[i][5] + '</td>';
		cadcontentrow += '<td >' + members[i][6] + '</td>';
		cadcontentrow += '<td >' + btnmod + '</td>';
		cadcontentrow += '<td >' + btndel + '<span id="sr'+members[i][0]+'"></span></td>';
		cadcontentrow += '</tr>';
	
		newcontent += cadcontentrow;
	}

	newcontent += "</table>";

	$("#locateobjetosweb").html(newcontent);
	$("#a_0").focus();
	return false;
}

function getOptionsObjetosweb(){
	var opt = {callback: pageselectCallbackObjetosweb};
	$("input:hidden").each(function(){opt[this.name] = this.className.match(/numeric/) ? parseInt(this.value) : this.value;});

	return opt;
}